#ifndef PROJECTMANAGER_H
#define PROJECTMANAGER_H

#include <wx/string.h>
#include "..\D-DrawTypes.h"

class D_DrawFrm;
class D_DrawProject;
class wxPoint;

enum SelectionMode{
	SelectionMode_size_horizontal = 0,
	SelectionMode_size_vertical = 1,
	SelectionMode_size_move = 2,
	SelectionMode_other = -1
	};

class ProjectManager{
	public:
	ProjectManager(D_DrawFrm* parent_frame);
	~ProjectManager();
	bool CreateProject(wxString name);
	bool OpenProject();
	bool CloseProject();
	bool SaveProject(bool always_ask_file_name);
	bool ExportProject();
	bool isThereActiveProject();
	bool AddRectangle(wxPoint* position);
	bool AddEllipse(wxPoint* position);
	bool AddTextEllipse(wxPoint* position);
	bool AddDiamond(wxPoint* position);
	bool AddTextDiamond(wxPoint* position);
	bool AddLabel(wxPoint* position);
	bool AddLabelRectangle(wxPoint* position);
	bool SelectElement(wxPoint* position);
	SelectionMode UpdateSelectionMode(wxPoint* position);
	bool DeleteElement(wxPoint* position);
	bool MoveElement(wxPoint* position);
	bool NodeStart(wxPoint* position);
	bool NodeStep(wxPoint* position);
	void ClearBridge();
	void MarkDirty();
	D_DrawProject* GetProject();
	D_DrawFrm* GetParentFrame();
	void SwitchUserResizingMode(SelectionMode mode, bool no_processing);
	void PostMousePosition(wxPoint position);
	void SetSelectedBridgeType(ElementType bridge_type);
	char** GetBridgeIcon();
	
	private:
	bool m_project_created;
	bool m_is_project_dirty;
	int m_project_id;
	D_DrawProject* m_project;
	D_DrawFrm* m_parent_frame;
	SelectionMode m_selection_mode;
	ElementType m_selected_bridge_type;
	};

#endif